let eventObject = {
    //元素的拖动事件的封装
    drag(el, fn) {
        el.addEventListener(
            'mousedown',
            function (e) {
                initX = e.clientX
                initY = e.clientY
                tp = parseInt(getComputedStyle(el, null).top)
                lft = parseInt(getComputedStyle(el, null).left)
                el.addEventListener('mousemove', move, false)
                el.addEventListener(
                    'mouseup',
                    function () {
                        fn()
                        el.removeEventListener('mousemove', move, false)
                        distanceX = 0
                        distanceY = 0
                    },
                    false
                )
            },
            false
        )
    },
}
let app = document.getElementById('app')
eventObject.drag(app, function () {
    console.log('在app元素上移动操作了')
})